
#include "pagebyCombo.h"


void MainWindow::setPage(int pageId)
{
    if (pageId < 0 || pageId >= PAGE_COUNT) {
        pageId = PAGE_PREVIEW;
    }

    const PageInfo &info = kPageTable[pageId];

    ui->stackedWidget->setCurrentIndex(info.stackedIndex);

    if (ui->lblPageTitle)
        ui->lblPageTitle->setText(info.title);
}

// 下拉框变更 → 按 index 当成枚举用
void MainWindow::on_combo_pages_currentIndexChanged(int index)
{
    setPage(index);
}
